<?php


namespace app\controller\coach;


use app\BaseController;
use app\model\article\NoticeModel;

class IndexController extends BaseController
{
    public function index()
    {
        return 'coach';
    }

    /**
     *获取配置信息
     * @return \think\response\Json
     */
    public function getAgreement()
    {
        try {
            $key = $this->request->param('key', '', 'trim');
            $date = NoticeModel::where('title', $key)->value('content');
            return $this->success($date);
        } catch (\Exception $exception) {
            return $this->error($exception);
        }
    }

    /**
     * 公众号ID
     * @return \think\response\Json
     */
    public function getAppId()
    {
        try {
            $data = config('payment.official_app_id');
            return $this->success($data);
        } catch (\Exception $exception) {
            return $this->error($exception);
        }
    }
}